import request from '@/utils/request'

// 查询业绩报表列表
export function listReport (query) {
  return request({
    url: '/manager/report/list',
    method: 'get',
    params: query
  })
}

// 查询业绩报表详细
export function getReport (id) {
  return request({
    url: '/manager/report/' + id,
    method: 'get'
  })
}

// 新增业绩报表
export function addReport (data) {
  return request({
    url: '/manager/report',
    method: 'post',
    data: data
  })
}

// 修改业绩报表
export function updateReport (data) {
  return request({
    url: '/manager/report',
    method: 'put',
    data: data
  })
}

// 删除业绩报表
export function delReport (id) {
  return request({
    url: '/manager/report/' + id,
    method: 'delete'
  })
}

// 查询业绩报表列表
export function homePageReprt (query) {
  return request({
    url: '/manager/report/getHomePageReport',
    method: 'get',
    params: query
  })
}

// 查询业绩报表列表
export function deptRank (query) {
  return request({
    url: '/manager/report/getHomePageDeptRank',
    method: 'get',
    params: query
  })
}

// 查询业绩报表列表
export function getUserReport (query) {
  return request({
    url: '/manager/report/getUserReport',
    method: 'get',
    params: query
  })
}

//获取渠道占比
export function getChannelReport (query) {
  return request({
    url: '/manager/report/getChannelReport',
    method: 'get',
    params: query
  })
}

// 查询个人业绩
export function getPersionReport (query) {
  return request({
    url: '/manager/report/getPersionReport',
    method: 'get',
    params: query
  })
}

// 查询个人业绩图表
export function getPersionReportChart (query) {
  return request({
    url: '/manager/report/getPersionReportChart',
    method: 'get',
    params: query
  })
}

export function getPackageReportChart (query) {
  return request({
    url: '/manager/report/getPackageReportChart',
    method: 'get',
    params: query
  })
}

export function getProportion (query) {
  return request({
    url: '/manager/report/getProportion',
    method: 'get',
    params: query
  })
}